<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>

<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <!-- 我的待审-审批 -->
    <form class="form-horizontal m" id="formId" th:object="${Form}">
        <input id="id" name="id" class="form-control" th:value="*{id}" type="hidden">
        <input  class="form-control" th:value="*{procInstanId}" type="hidden">
        <input id="id" name="taskId" class="form-control" type="hidden" th:value="${taskId}">
        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">标题(Title)：</label>-->
            <!--<div class="col-sm-8">-->
                <!--<input readonly="readonly" name="title" th:value="*{title}" class="form-control" value="test" type="text">-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">类型：</label>-->
            <!--<div class="col-sm-8 form-control-static" th:text="*{leaveType}">-->
            <!--</div>-->
        <!--</div>-->

        <div class="form-group">
            <label class="col-sm-3 control-label">申请人(Requestor)：</label>
            <div class="col-sm-8">
                <input readonly="readonly" id="proposer_Id" name="proposer_Id" class="form-control" type="text" th:field="*{proposer_Id}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">客户(Customer)：</label>
            <div class="col-sm-8">
                <input readonly="readonly" id="customer" name="customer" class="form-control" type="text" th:field="*{customer}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">支持项目(Project)：</label>
            <div class="col-sm-8">
                <input readonly="readonly" id="supportingProject" name="supportingProject" class="form-control" type="text" th:field="*{supportingProject}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">普工(Normal)：</label>
            <div class="col-sm-3">
                <input readonly="readonly" id="requestedOne" name="requestedOne" class="form-control" type="text" th:field="*{requestedOne}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">缝工(Sewing)：</label>
            <div class="col-sm-3">
                <input readonly="readonly" id="requestedTwo" name="requestedTwo" class="form-control" type="text" th:field="*{requestedTwo}">
            </div>
        </div>

        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">需求开始时间：</label>-->
            <!--<div class="col-sm-8 form-control-static" th:text="*{#dates.format(leaveTime,'yyyy-MM-dd HH:mm:ss')}">-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">需求结束时间：</label>-->
            <!--<div class="col-sm-8 form-control-static" th:text="*{#dates.format(expireTime,'yyyy-MM-dd HH:mm:ss')}">-->
            <!--</div>-->
        <!--</div>-->

        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间(Start Time)：</label>
            <div class="col-sm-8">
                <input readonly="readonly" th:value="*{#dates.format(leaveTime,'yyyy-MM-dd HH:mm')}"  id="leaveTime" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">结束时间(End Time)：</label>
            <div class="col-sm-8">
                <input readonly="readonly" th:value="*{#dates.format(expireTime,'yyyy-MM-dd HH:mm')}" id="expireTime" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">时间合计(Total Time)：</label>
            <div class="col-sm-8">
                <input readonly="readonly" th:value="*{totalTime}" id="totalTime" class="form-control" type="text" >
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注(Remark)：</label>
            <div class="col-sm-8">
                <textarea readonly="readonly" name="leaveContent" type="text" th:text="*{leaveContent}"
                          class="form-control"></textarea>
            </div>
        </div>

        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">上级审批状态:</br>(Status)</label>-->
            <!--<div class="col-sm-8">-->
                <!--<label class="checkbox-inline i-checks">-->
                    <!--<span th:if="*{status} eq '1'" class="btn btn-warning btn-xs ">待审批</span>-->
                    <!--<span th:if="*{status} eq '2'" class="btn btn-success btn-xs ">同意</span>-->
                    <!--<span th:if="*{status} eq '3'" class="btn btn-danger btn-xs ">拒绝</span>-->
                <!--</label>-->
            <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">下一个审批人:</br>(Next approver)</label>
            <div class="col-sm-8">
                <!--<input name="roomName" type="text" th:value="${roomName}"  class="form-control"/>-->
                <select name="agent_Id" class="form-control">
                    <!--<option value="">&#45;&#45;</option>-->
                    <!--<option th:each="user:${users}" th:value="${user.uid}" th:text="${user.name}"></option>-->
                    <option th:each="approver:${approver}" th:value="${approver.uid}" th:text="${approver.name}"></option>
                </select>
                <!-- 正式上线切换开始 -->
                <!--<input readonly="readonly" id="name" name="agent_Id" th:value="${approver.uid}" th:field="${approver.name}" class="form-control"  type="text">-->
                <!-- 正式上线切换结束 -->
            </div>
        </div>

        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">部门经理审批意见：</br>(Department manager approves opinions)</label>-->
            <!--<div class="col-sm-8">-->
                <!--<textarea readonly="readonly" name="leaveContent" type="text" th:text="*{reply}"-->
                          <!--class="form-control"></textarea>-->
            <!--</div>-->
        <!--</div>-->

        <div class="form-group">
            <label class="col-sm-3 control-label">您的审批意见:</br>(Your approval opinion)</label>
            <div class="col-sm-8">
                <textarea  type="text" name="reply"
                          class="form-control"></textarea>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">状态(Status)：</label>
            <div class="col-sm-8">
                <label class="checkbox-inline i-checks">
                    <input type="radio" name="status" value="2" checked/>
                    同意
                </label>
                <label class="checkbox-inline i-checks">
                    <input type="radio" name="status" value="3"/>
                    拒绝
                </label>
            </div>
        </div>

        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label">文件(File)：</label>-->
            <!--<div class="col-sm-8">-->
                <!--<input name="file" onchange="change()" id="file" class="form-control" type="file">-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="form-group" id="size" style="display: none">-->
            <!--<label class="col-sm-3 control-label" for="FileSize">大小：</label>-->
            <!--<div class="col-sm-8">-->
                <!--<input class="form-control" id="FileSize" type="text">-->
            <!--</div>-->
        <!--</div>-->

        <div class="form-group" shiro:hasPermission="task:update" >
            <div class="form-control-static col-sm-offset-9">
                <button type="submit" class="btn btn-primary" onclick="approve">审批</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<script type="text/javascript">

    var prefix = "/task";
    $("#formId").validate({
        rules:{
            agent_Id:{
                required:true,
            }
            ,
            reply:{
                required:true,
            }
        },
        submitHandler: function(form) {
            $.operate.save(prefix + "/LeaveApproval", $('#formId').serialize());
        }
    })
</script>
</body>
</html>
